<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  
</head>
<body>
  <div id="app">
    <ul>
      <li v-for="item in arr">
        {{item}}
      </li>
    </ul>
    <!-- 循环时 得到下标 -->
    <ul>
      <li v-for="(item, index) in arr">
        {{item}}
        -->
        {{index}}
      </li>
    </ul>
    <hr>
    <div v-for="(stu,index) in stus">
      <h2>学生名:{{stu.name}}</h2>
      <p>学生姓名: {{stu.age}}</p>
      <p>学生性别：{{stu.gender === 0? '男':'女'}}</p>
    </div>
    <hr>
    <ul>
      <li v-for="(value, key, index) in obj">
        {{value}}
        -->
        {{key}}
        -->
        {{index}}
      </li>
    </ul>
  </div>
  <script src="./vue.global.js"></script>
  <script>
    const { createApp } = Vue;
    const app = createApp({
      data(){
        return {
          arr: ['a', 'b', 'c', 'd'],
          stus: [
            {
              name: '小明',
              age: 18,
              gender: 0
            },
            {
              name: '小红',
              age: 16,
              gender: 1
            }
          ],
          obj: {
            a: 'a属性',
            b: 'b属性',
            c: 'c属性'
          }
        }
      }
    })

    app.mount('#app')
  </script>
</body>
</html>